package net.tycmc.cty.ctyms.web.Action;

import java.io.IOException;
import java.io.PrintWriter;

import net.tycmc.cty.ctyms.timejob.iems.service.EffectivenessStatService;

public class MaexecuteEffectAction extends BaseActionS2{

	private  EffectivenessStatService effectivenessStatService;

	public EffectivenessStatService getEffectivenessStatService() {
		return effectivenessStatService;
	}

	public void setEffectivenessStatService(
			EffectivenessStatService effectivenessStatService) {
		this.effectivenessStatService = effectivenessStatService;
	}
	public String init(){
		return "MaexecuteEffectInit";
	}
	public void executeEffect() throws IOException{
		PrintWriter out = response.getWriter();
		boolean result = effectivenessStatService.startWork(true);
		if(result){
			out.print("{'result':'success'}");
		}else{
			out.print("{'result':'fault'}");
		}
//		out.print("<script language='javascript'>");
//		out.print("alert('时效统计作业开始执行！请耐心等待！不要重复操作');");
//		out.print("</script>");
	}
}
